import request from '@/utils/request' // 培训课程
// import { makeFormData } from '@/utils/util'
// transferFormData
const clueApi = {
  chapter: '/web/course/courseChildList', // 章节列表
  add: '/web/course/createCourseChild', // 新增章节
  course: '/web/course/courseList', // 课程列表
  addCourse: '/web/course/createCourse', // 新增
  delete: 'web/course/delete_area_bulid_course_ById', // 课程列表删除
  courseInfo: '/web/course/courseChildDetail', // 章节详情
  updataCourse: '/web/course/editCourseChild', // 修改章节
  deleteCourse: '/web/course/removeCourseChildAll', // 删除章节
  stateCourse: '/web/course/editStatus' // 屏蔽
}

export function getPerformanceList (data = {}) {
  return request({
    url: clueApi.chapter,
    method: 'post',
    data
  })
}

export function getCourseList (data = {}) {
  return request({
    url: clueApi.course,
    method: 'post',
    data
  })
}

export function addCourseList (data = {}) {
  return request({
    url: clueApi.addCourse,
    method: 'post',
    data
  })
}

export function deleteList (params = {}) {
  return request({
    url: clueApi.delete,
    method: 'post',
    params
  })
}

export const addChapter = (data = {}) => {
  return request({
    url: clueApi.add,
    method: 'post',
    data
  })
}

export const courseInfo = (params = {}) => {
  return request({
    url: clueApi.courseInfo,
    method: 'get',
    params
  })
}

export const courseUpdate = (data = {}) => {
  return request({
    url: clueApi.updataCourse,
    method: 'POST',
    data
  })
}

export const courseDelete = (params = {}) => {
  return request({
    url: clueApi.deleteCourse,
    method: 'get',
    params
  })
}

export const courseState = (params = {}) => {
  return request({
    url: clueApi.stateCourse,
    method: 'get',
    params
  })
}
